home *** CD-ROM | disk | FTP | other *** search
/ Champak 86 / (Vol 86) My Disc.iso / Games / habilidade_1209.swf / scripts / DefineSprite_547 / frame_1 / DoAction.as
Text File  |  2009-04-22  |  2KB  |  96 lines

  1. function loadData(arg)
  2. {
  3.    resetField();
  4.    var _loc1_ = new LoadVars();
  5.    var _loc2_ = new LoadVars();
  6.    _loc2_.onLoad = function(s)
  7.    {
  8.       if(s)
  9.       {
  10.          if(Number(this.rsCnt == 0))
  11.          {
  12.             msg_mc.msg_txt.text = "???? ????.";
  13.             msg_mc._visible = true;
  14.          }
  15.          else
  16.          {
  17.             rankingData = this;
  18.             setData();
  19.          }
  20.       }
  21.       else
  22.       {
  23.          msg_mc.msg_txt.text = "?? ??? ????.";
  24.          msg_mc._visible = true;
  25.       }
  26.    };
  27.    if(arg == "today")
  28.    {
  29.       menu_mc.prevFrame();
  30.    }
  31.    else
  32.    {
  33.       menu_mc.nextFrame();
  34.    }
  35.    msg_mc.msg_txt.text = "??? ??...";
  36.    msg_mc._visible = true;
  37.    _loc1_.game_id = game_id;
  38.    _loc1_.loadType = arg;
  39.    _loc1_.sendAndLoad(baseURL + sScript1,_loc2_,"post");
  40. }
  41. function sendData()
  42. {
  43.    var _loc1_ = new LoadVars();
  44.    var _loc2_ = new LoadVars();
  45.    _loc2_.onLoad = function(s)
  46.    {
  47.       if(s)
  48.       {
  49.          loadData("today");
  50.       }
  51.    };
  52.    msg_mc.msg_txt.text = "??? ??...";
  53.    msg_mc._visible = true;
  54.    _loc1_.game_id = game_id;
  55.    _loc1_.score = score;
  56.    _loc1_.sendAndLoad(baseURL + sScript2,_loc2_,"post");
  57. }
  58. function resetField()
  59. {
  60.    var _loc2_ = this;
  61.    myRank.text = "";
  62.    myScore.text = "";
  63.    var _loc1_ = 0;
  64.    while(_loc1_ < 10)
  65.    {
  66.       _loc2_["user_id" + _loc1_].text = "";
  67.       _loc2_["score" + _loc1_].text = "";
  68.       _loc2_["date" + _loc1_].text = "";
  69.       _loc1_ = _loc1_ + 1;
  70.    }
  71. }
  72. function setData()
  73. {
  74.    var _loc2_ = this;
  75.    msg_mc.msg_txt.text = "";
  76.    msg_mc._visible = false;
  77.    myRank.text = rankingData.myrank;
  78.    myScore.text = rankingData.myscore;
  79.    var _loc1_ = 0;
  80.    while(_loc1_ < 10)
  81.    {
  82.       _loc2_["user_id" + _loc1_].text = rankingData["id" + _loc1_];
  83.       _loc2_["score" + _loc1_].text = rankingData["score" + _loc1_];
  84.       _loc2_["date" + _loc1_].text = rankingData["date" + _loc1_];
  85.       _loc1_ = _loc1_ + 1;
  86.    }
  87. }
  88. stop();
  89. var baseURL = _parent.baseURL;
  90. var sScript1 = _parent.sScript1;
  91. var sScript2 = _parent.sScript2;
  92. var game_id = _parent.game_id;
  93. var isLogin = Number(_parent.isLogin);
  94. var score = _parent.score;
  95. var rankingData = new Object();
  96.